package com.fly.springbootTemplate.controller;

import com.fly.springbootTemplate.entity.StudentClass;
import com.fly.springbootTemplate.service.StudentClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/studentClass")
public class StudentClassController {
    @Autowired
    private StudentClassService studentClassService;
    @RequestMapping("/addClass")
    public boolean addClass(StudentClass studentClass) {
       return studentClassService.addClass(studentClass);
    }
    @RequestMapping("/deleteClass")
    public boolean deleteClass(String studentId) {
        return studentClassService.deleteClass(studentId);
    }
    @RequestMapping("/updateClass")
    public boolean updateClass(StudentClass studentClass) {
        return studentClassService.updateClass(studentClass);
    }
    @RequestMapping("/getAllClass")
    public List<StudentClass> getAllClass() {
        return studentClassService.getAllClass();
    }
    @RequestMapping("/getClassById")
    public StudentClass getClassById(String classId) {
        return studentClassService.getClassById(classId);
    }
}
